﻿using System;
using System.Windows.Forms;

namespace SolidQ.CommonLibraries.GestionErrores
{
    public partial class ErrorForm : Form
    {
        public string TextoLargo
        {
            get { return (textBoxTextoLargo.Text); }
            set { textBoxTextoLargo.Text = value; }
        }
        public string TextoCorto
        {
            get { return (textBoxTextoCorto.Text); }
            set { textBoxTextoCorto.Text = value; }
        }

        public string InnerMessage
        {
            get { return (textBoxInnerException.Text); }
            set { textBoxInnerException.Text = value; }
        }

        public ErrorForm()
        {
            InitializeComponent();            
        }

        public ErrorForm(string title)
        {
            InitializeComponent();
            this.Text = title;            
        }

        private void buttonClose_Click(object sender, EventArgs e)
        {
            this.Hide();
            this.Close();
        }

        public void ShowLinkToErrorLogFile(string fullPathToErrorLogFile)
        {
            linkLabel1.Links.Add(0, fullPathToErrorLogFile.Length, fullPathToErrorLogFile);
            linkLabel1.Enabled = true;
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start(e.Link.LinkData.ToString());
        }
    }
}
